package engine.services;

import java.util.List;

import engine.dataobjects.MailItem;
import engine.dataobjects.MailItemInstance;


public interface IDataResource<T, U> {
	
	public void init();
	
	public void load();

	public void refresh();

	public List<MailItemInstance<U>> getActiveMailItemInstances();
	
	public List<MailItem<T>> getAllMailItems();

	public void setAutoSave(boolean isAutoSave);
	
	public void addMailItem(MailItem<T> item) throws Exception;

	public void updateMailItem(MailItem<T> item) throws Exception;

	public void deleteMailItem(MailItem<T> item) throws Exception;

	public void addMailItemInstance(MailItemInstance<U> item) throws Exception;

	public void updateMailItemInstance(MailItemInstance<U> item) throws Exception;

	public void deleteMailItemInstance(MailItemInstance<U> item) throws Exception;

	
	public MailItem<T> getMailItem(String id) throws Exception;
	
	public void save() throws Exception;

}
